package com.xk857.forum.controller.pub;


import com.xk857.entities.Replay;
import com.xk857.forum.service.IReplayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 星空小屋-回复论坛信息表 前端控制器
 *
 * @author CV大魔王
 * @since 2021-02-23
 */
@Api(value = "评论信息接口(公开)", tags = "评论信息接口(公开)")
@RestController
@RequestMapping("/pub/replay")
public class PubReplayController {

    @Autowired
    private IReplayService replayService;


    @ApiOperation("通过话题ID递归查询所有评论")
    @ApiImplicitParam(name="forumId", value="话题ID", required=true)
    @GetMapping("/list/{forumId}")
    public List<Replay> findByQuestionId(@PathVariable("forumId") String forumId) {
        return replayService.findByForumId(forumId);
    }


}
